import 'package:flutter/material.dart';

import 'package:get/get.dart';
import 'package:getx_learn/app/common/widgets/widgets.dart';
import 'package:getx_learn/app/modules/index/controllers/index_controller.dart';
import 'package:getx_learn/app/routes/app_pages.dart';
import 'package:getx_learn/generated/locales.g.dart';


class IndexView extends GetView<IndexController> {
  const IndexView({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    controller;
    return Scaffold(
      appBar: getAppBar(
        context: context,
        title: "Getx 功能列表",
      ),
      body: ListView(
        children: [
          // 导航
          ListTile(
            title: const Text("导航demo"),
            subtitle: const Text('导航相关内容的测试'),
            onTap: () => Get.toNamed(Routes.NAVIGATION_DEMO, arguments: "导航demo"),
          ),
          const Divider(),

          // 多语言
          ListTile(
            title: const Text("多语言demo"),
            subtitle:  Text('多语言相关的测试内容${LocaleKeys.hello.tr}'),
            onTap: () => Get.toNamed(Routes.LANGUAGE_DEMO, arguments: "多语言demo"),
          ),
          const Divider(),


          // 组件
          ListTile(
            title: const Text("组件"),
            subtitle:  Text('snackbar、dialog、bottomSheet 等'),
            onTap: () => Get.toNamed(Routes.COMPOSE_DEMO),
          ),
          const Divider(),

          // 状态管理
          ListTile(
            title: const Text("状态管理"),
            subtitle:  Text('状态管理、懒加载'),
            onTap: () => Get.toNamed(Routes.STATE_MANAGER_DEMO),
          ),
          const Divider(),

          // 生命周期
          ListTile(
            title: const Text("GetxController"),
            subtitle:  Text('生命周期、StateMixin'),
            onTap: () => Get.toNamed(Routes.GETX_CONTROLLER_DEMO),
          ),
          const Divider(),

          ListTile(
            title: const Text("GetUtils介绍"),
            subtitle:  Text('GetUtils是getx为我们提供一些常用的工具类库'),
            onTap: () => Get.toNamed(Routes.GET_UTILS_DEMO),
          ),
          const Divider(),

          ListTile(
            title: const Text("GetView和GetWidget"),
            subtitle:  Text('GetView和GetWidget是有区别的'),
            onTap: () => Get.toNamed(Routes.GET_VIEW_AND_GET_WIDGET),
          ),
          const Divider(),

          ListTile(
            title: const Text("Android深层链接（Deep Link）"),
            subtitle:  Text('测试通过网页打开'),
            onTap: () => Get.toNamed(Routes.DEEP_LINK_DEMO),
          ),
          const Divider(),

          ListTile(
            title: const Text("仿微信朋友圈发布"),
            subtitle:  Text('模仿微信朋友圈发布功能'),
            onTap: () => Get.toNamed(Routes.WEICHAT_POST),
          ),
          const Divider(),

        ],
      ),
    );
  }
}
